package com.ht.mt.sric.dto;

import com.ht.mt.sric.entity.Coordenada;
import com.ht.mt.sric.entity.Tramo;
import com.ht.mt.sric.entity.Ubigeo;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.List;



public class TramoDto implements Serializable{
    @SuppressWarnings("compatibility:-2897857890105148790")
    private static final long serialVersionUID = 1L;


    private Integer idTrm;
    
    private String cdgMtTrm;
     private String finTrm;
    
    private String incTrm;
    private Double lngtdTrm;
    private String nmbrTrm;
   private String tpTrm;
   private Integer idUbgo;
   
     private List<Coordenada> coordenadaList;



     public static List<Tramo> getListTramo(List<TramoDto> lstDto){
         try{
             List<Tramo> result=null;
             if(lstDto!=null && !lstDto.isEmpty()){
                 result=new ArrayList<>();
                 for(int i=0;i<lstDto.size();i++){
                     result.add( toBeanTramo(lstDto.get(i)) );
                 }
             }
             
             return result;
         }catch(Exception e){
             e.printStackTrace();
             return null;
         }
        
     }
     
    public static List<TramoDto> getListTramoDto(List<Tramo> lstBean){
        try{
            List<TramoDto> result=null;
            if(lstBean!=null && !lstBean.isEmpty()){
                result=new ArrayList<>();
                for(int i=0;i<lstBean.size();i++){
                    result.add( toDtoTramo(lstBean.get(i)) );
                }
            }
            
            return result;
        }catch(Exception e){
            e.printStackTrace();
            return null;
        }
       
    }
     
     
    public static TramoDto toDtoTramo(Tramo bean){
        try{
            TramoDto trm=null;
            if(bean!=null){
                trm=new TramoDto();
                trm.setIdTrm(bean.getIdTrm());
                trm.setIncTrm(bean.getIncTrm());
                trm.setFinTrm(bean.getFinTrm());
                trm.setLngtdTrm(bean.getLngtdTrm());
                trm.setNmbrTrm(bean.getNmbrTrm());
                trm.setTpTrm(bean.getTpTrm());
                trm.setCdgMtTrm(bean.getCdgMtTrm());
                trm.setIdUbgo(bean.getUbigeo().getIdUbgo());
            }
            
            return trm;
        }catch(Exception e){
            e.printStackTrace();
            return null;
        }
    }
     public static Tramo toBeanTramo(TramoDto dto){
         try{
             Tramo trm=null;
             if(dto!=null){
                 trm=new Tramo();
                 trm.setIdTrm(dto.getIdTrm());
                 trm.setIncTrm(dto.getIncTrm());
                 trm.setFinTrm(dto.getFinTrm());
                 trm.setLngtdTrm(dto.getLngtdTrm());
                 trm.setNmbrTrm(dto.getNmbrTrm());
                 trm.setTpTrm(dto.getTpTrm());
                 trm.setCdgMtTrm(dto.getCdgMtTrm());
                 trm.setUbigeo(new Ubigeo(dto.getIdUbgo(),""));
             }
             
             return trm;
         }catch(Exception e){
             e.printStackTrace();
             return null;
         }
     }
    public void setIdTrm(Integer idTrm) {
        this.idTrm = idTrm;
    }

    public Integer getIdTrm() {
        return idTrm;
    }

    public void setCdgMtTrm(String cdgMtTrm) {
        this.cdgMtTrm = cdgMtTrm;
    }

    public String getCdgMtTrm() {
        return cdgMtTrm;
    }

    public void setFinTrm(String finTrm) {
        this.finTrm = finTrm;
    }

    public String getFinTrm() {
        return finTrm;
    }

    public void setIncTrm(String incTrm) {
        this.incTrm = incTrm;
    }

    public String getIncTrm() {
        return incTrm;
    }

    public void setLngtdTrm(Double lngtdTrm) {
        this.lngtdTrm = lngtdTrm;
    }

    public Double getLngtdTrm() {
        return lngtdTrm;
    }

    public void setNmbrTrm(String nmbrTrm) {
        this.nmbrTrm = nmbrTrm;
    }

    public String getNmbrTrm() {
        return nmbrTrm;
    }

    public void setTpTrm(String tpTrm) {
        this.tpTrm = tpTrm;
    }

    public String getTpTrm() {
        return tpTrm;
    }

    public void setIdUbgo(Integer idUbgo) {
        this.idUbgo = idUbgo;
    }

    public Integer getIdUbgo() {
        return idUbgo;
    }

    public void setCoordenadaList(List<Coordenada> coordenadaList) {
        this.coordenadaList = coordenadaList;
    }

    public List<Coordenada> getCoordenadaList() {
        return coordenadaList;
    }

}
